package com.ysd.lis.entity;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;

import java.sql.Timestamp;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.models.auth.In;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 核算结果-Sql记录表
 * </p>
 *
 * @author LiuQi
 * @since 2024-04-25
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("WK_CALC_RESULT_SQL")
public class WkCalcResultSql extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 核算要素ID
     */
    @TableField("ELEMENT_ID")
    private String elementId;

    /**
     * 核算公式ID
     */
    @TableField("FORMULA_ID")
    private String formulaId;

    /**
     * 核算公式编码
     */
    @TableField("FORMULA_CODE")
    private String formulaCode;

    /**
     * 核算公式ID
     */
    @TableField("FORMULA_NAME")
    private String formulaName;

    /**
     * 核算公式中的位置标识
     */
    @TableField("FORMULA_INDEX")
    private Integer formulaIndex;

    /**
     * 用户ID
     */
    @TableField("USER_ID")
    private String userId;

    /**
     * 用户编码
     */
    @TableField("USER_CODE")
    private String userCode;

    /**
     * 用户名称
     */
    @TableField("USER_NAME")
    private String userName;

    /**
     * 开始日期
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
    @TableField("START_DATE")
    private Timestamp startDate;

    /**
     * 结束日期
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
    @TableField("END_DATE")
    private Timestamp endDate;

    /**
     * 公式
     */
    @TableField("FORMULA")
    private String formula;

    /**
     * 计算结果
     */
    @TableField("RESULT")
    private double result;

    /**
     * 替换完sql
     */
    @TableField("SQL_VALUE")
    private String sqlValue;

    @TableField(exist = false)
    private String databaseName;
    @TableField(exist = false)
    private String databaseCode;
    @TableField(exist = false)
    private Long databaseType;
    @TableField(exist = false)
    private String host;
    @TableField(exist = false)
    private String port;
    @TableField(exist = false)
    private String dataUsername;
    @TableField(exist = false)
    private String password;
    @TableField(exist = false)
    private String database;
}
